#include "performance.h"

#include <iostream>
using namespace std;

Performance::Performance( char* pLabel )
:running(false),mStart(0),mStop(0),mElapsed(0)
{
    mLabel = string(pLabel);
}

void Performance::start()
{
    running = true;
    mStart = clock();
}

void Performance::stop()
{
    running = false;
    mStop = clock();
    mElapsed += (mStop - mStart);
}

clock_t Performance::elapsed()
{
    return mElapsed;
}

void Performance::report()
{
    cout<<"#Performance\t"<<mLabel<<" Elapsed:"<<elapsed()<<endl;
}
